import os
import sys
#
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# print(BASE_DIR)
sys.path.insert(0, os.path.join(BASE_DIR, 'common'))
sys.path.insert(0, BASE_DIR)

print(sys.path)
from toutiao import create_app
from settings.default import DefaultConfig
from flask import jsonify

app = create_app(DefaultConfig)

@app.route('/')
def index():
    data = {}
    for rule in app.url_map.iter_rules():
        data[rule.endpoint] = rule.rule
    return jsonify(data)


if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0')

